package com.yudaob2b.elong.controller.monitor;

import com.yudaob2b.common.utils.ABSResponse;
import com.yudaob2b.elong.service.AsyncThreadPoolMetricsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 监控controller
 *
 * @author Kidd.Tan
 * @email 298023780@qq.com
 * @date 7/21/18 12:10 PM
 */
@RestController
@RequestMapping("/api/monitor")
public class ApiMonitorController {

    @Autowired
    private AsyncThreadPoolMetricsService asyncThreadPoolMetricsService;

    /**
     * 监控线程池情况
     *
     * @return
     */
    @RequestMapping("/taskExecutor")
    public ABSResponse test() {
        return ABSResponse.ok(asyncThreadPoolMetricsService.metrics());
    }
}
